/*
 *  This file is part of Spidex.
 *  
 *  Spidex is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Spidex is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Spidex.  If not, see <http://www.gnu.org/licenses/>.
 */

package spidex.table;

import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author xatrix
 */
public class DVDInfoTableModel {
    private static final DVDInfoTableModel MODEL = new DVDInfoTableModel();
   
    private DVDInfoTableModel() {
        
    }
    
    public static DVDInfoTableModel getInstance() {
        return MODEL;
    }
    
    public DefaultTableModel getModel() {
        DefaultTableModel model = new DefaultTableModel(
                new String[]{"ID","Poster","Name"}, 0
            ) {
            public Class getColumnClass(int columnIndex) {
                if(columnIndex == 0) 
                    return Integer.class;
                if(columnIndex == 1) 
                    return ImageIcon.class;
                
                return String.class;
            }
 
            public boolean isCellEditable(int rowIndex, int columnIndex){
                return false;
            }
        };
        return model;
    }

}
